//
//  ChooseView.m
//  Koizora
//
//  Created by dlios on 15-6-11.
//  Copyright (c) 2015年 CupCat. All rights reserved.
//

#import "ChooseView.h"
#import "HomeTestViewController.h"

@implementation ChooseView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.button1 = [UIButton buttonWithType:UIButtonTypeSystem];
        _button1.backgroundColor = [UIColor yellowColor];
        [self addSubview:_button1];
        
        self.button2 = [UIButton buttonWithType:UIButtonTypeSystem];
        _button2.backgroundColor = [UIColor yellowColor];
        [self addSubview:_button2];
        
        self.button3 = [UIButton buttonWithType:UIButtonTypeSystem];
        _button3.backgroundColor = [UIColor yellowColor];
        [self addSubview:_button3];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    _button1.frame = CGRectMake(0, 5, 40, 40);
    _button1.tag = 1000;
    [_button1 addTarget:self action:@selector(button11: ) forControlEvents:UIControlEventTouchUpInside];
    _button2.frame = CGRectMake(0, _button1.frame.origin.y + 5 + _button1.frame.size.height, 40, 40);
    _button2.tag = 2000;
    [_button2 addTarget:self action:@selector(button22:) forControlEvents:UIControlEventTouchUpInside];
    _button3.frame = CGRectMake(0, _button2.frame.size.height + _button2.frame.origin.y + 5, 40, 40);
    _button3.tag = 3000;
    [_button3 addTarget:self action:@selector(button33:) forControlEvents:UIControlEventTouchUpInside];
    
}
- (void)button11:(UIButton *)but
{
    [self.delegate pushButton1];
}
- (void)button22:(UIButton *)but
{
    [self.delegate pushButton2];

}
- (void)button33:(UIButton *)but
{
    [self.delegate pushButton3];

}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
